<template>
  <el-input :placeholder="propertyForm.placeholder?propertyForm.placeholder:''" size="small" class="w-140 mr-10" v-model="propertyForm.valueText"></el-input>
</template>
<script>

  export default {
    name: 'inputModle',
    props: ['property'],
    watch: {
      property: {
        immediate: true,
        handler(val) {
          // console.log('val,',val)
          this.propertyForm = this.getJson(val)
        }
      },
      'propertyForm.valueText': {
        handler() {
          // console.log('更新啦input：', val)
          this.$emit('updateVal', {'input':this.propertyForm})
        },
        deep: true
      },
    },
    data () {
      return {
        propertyForm:{}
      }
    },
    created () {
    },
    methods: {
      getJson(item){
        return JSON.parse(JSON.stringify(item))
      }
    },
    mounted () {
      // this.$emit('update:property', this.propertyForm)
    }
  }
</script>
